<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
    <%@ include file="/web/header.jsp"%>
    <title>主页</title>
</head>
<body class="layui-layout-body">
    <div class="layui-layout layui-layout-admin">
        <div class="layui-header">
            <div class="layui-logo">JAVA-0000</div>
            <ul class="layui-nav layui-layout-left"></ul>
            <ul class="layui-nav layui-layout-right">
                <li class="layui-nav-item">
                    <a href="javascript:;"> 
                        <img src="<%=app%>/web/base/img/fei.png"class="layui-nav-img"/>
<!--                         <img src="" class="layui-nav-img"/> -->
                                                                用户
                        [${user.name}]
                    </a>
                    <dl class="layui-nav-child">
                        <dd>
                            <a href="javascript:openUpd()">修改资料</a>
                        </dd>
                        <dd>
                            <a href="javascript:openPass()">修改密码</a>
                        </dd>
                        <dd>
                            <a href="javascript:openPic()">修改头像</a>
                        </dd>
                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a href="javascript:goLogout()">注销</a>
                </li>
            </ul>
        </div>

        <div class="layui-side layui-bg-black">
            <div class="layui-side-scroll">
                <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
                <ul class="layui-nav layui-nav-tree" >
                    <li class="layui-nav-item layui-nav-itemed">
                        <a href="javascript:;">信息维护</a>
                        <dl class="layui-nav-child">
                            <dd>
                                <a href="javascript:;" data-url="/web/page/department/list.jsp"
                                class="site-demo-active">部门信息维护</a>
                            </dd>
                            <dd>
	                            <a href="javascript:;" data-url="/web/page/employee/list.jsp"
	                            class="site-demo-active">员工信息维护</a>
                            </dd>
                            <dd>
                                <a href="javascript:;" data-url="/web/page/addr/addrlist.jsp"
                                class="site-demo-active">项目信息维护</a>
                            </dd>
                             <dd>
                                <a href="javascript:;" data-url="/web/page/addr/addrlist.jsp"
                                class="site-demo-active">绩效信息维护</a>
                            </dd>
                        </dl>
                    </li>
                    <li class="layui-nav-item">
                        <a href="javascript:;">基础配置</a>
                        <dl class="layui-nav-child">
                            <dd>
                                <a href="javascript:;" 
                                class="site-demo-active" 
                                data-url="/web/page/dict/dictlist.jsp">
                                                                                        基础数据维护</a>
                            </dd>
                            <dd>
                                <a href="javascript:openURL('/web/404.jsp');" 
                                class="site-demo-active">其他2</a>
                            </dd>
                            <dd>
                                <a href="javascript:;" class="site-demo-active" 
                                data-url="/web/404.jsp">其他1</a>
                            </dd>
                        </dl>
                    </li>
                </ul>
            </div>
        </div>
        <div class="layui-body"><!-- 内容主体区域 -->
            <iframe name="rightframe" width="99%" height="97%" ></iframe>
        </div>
        <div class="layui-footer">© JAVA.com - 底部固定区域</div>
    </div>
    <script type="text/javascript">
    element.render();
    $('.site-demo-active').click(function() {
        window.open(base.app + $(this).data('url'), "rightframe");
    });
    $('.site-demo-active:first').click();
    function goLogout(){
//         goJspLogin()
    	openConfirm(function(index) {
            layer.close(index);
            goJsp("/employee?action=logout");
        }, '确定注销？');
    }
    function openURL(url){
        window.open(base.app + url, "rightframe");
    }
    function openUpd(){
        openLayer('/web/page/employee/upd.jsp?code=${user.code}',refresh)
    }
    function openPass(){
        openLayer('/web/page/employee/updPass.jsp?code=${user.code}',refresh)
    }
    function openPic(code){
        openLayer('/web/page/employee/userPic.jsp?code=${user.code}',refresh)
    }
    function refresh(){
    	location.reload();
    }
    function initImage(){
    	var image = '${user.image}';
    	image=image?"/image/"+image:base.app+"/web/base/img/fei.png";
        $('img[class="layui-nav-img"]').attr('src',image)
    }
    initImage();
    </script>
</body>
</html>